/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.impl;

import java.lang.reflect.Constructor;

public class ClassUtilFixture {
	public Constructor getConstructor(Class aClass, Class[] parameterTypes) {
		try {
			return aClass.getConstructor(parameterTypes);
		}
		catch (SecurityException securityException) {
			throw new RuntimeException(securityException);
		}
		catch (NoSuchMethodException noSuchMethodException) {
			throw new RuntimeException(noSuchMethodException);
		}
	}

	public Constructor getConstructor(Class aClass) {
		return getConstructor(aClass, new Class[0]);
	}

	public Constructor getConstructor(Class aClass, Class parameterType) {
		return getConstructor(aClass, new Class[] {parameterType});
	}
}